package com.csgc.camera.biz.vip

import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle

import com.csgc.camera.base.BaseBindingActivity
import com.csgc.camera.bean.VipEquitiesPageData

import com.csgc.camera.util.AppUtil
import com.csgc.camera.util.clickWithTrigger
import com.cysd.spsyxj.R
import com.cysd.spsyxj.databinding.ActivityVipEquitiesBinding

import com.gyf.immersionbar.ktx.immersionBar

class VipEquitiesActivity:BaseBindingActivity<ActivityVipEquitiesBinding>(ActivityVipEquitiesBinding::inflate) {

    companion object{
        fun launch(context: Context){
            context.startActivity(Intent(context,VipEquitiesActivity::class.java))
        }
    }
    private val listTab:ArrayList<VipEquitiesPageData> by lazy {
       val datas =  ArrayList<VipEquitiesPageData>()
        datas.add(VipEquitiesPageData(1,"海量水印","涵盖多工作场景，几十种水印样式无限用，拍照更 高效", R.drawable.img_privilege_1))
        datas.add(VipEquitiesPageData(2,"免看广告","开通会员后可免除所有位置包含[广告]标的内容", R.drawable.img_privilege_2))
        datas.add(VipEquitiesPageData(3,"精美滤镜","开通会员后有多重精美滤镜无限使用，拍照更好看，记录美好生活幸福时光", R.drawable.img_privilege_3))
        datas.add(VipEquitiesPageData(4,"边拼边拍","可以一键生成拼图，边拍照边拼图，多种排列方式可选，汇报省心更便捷", R.drawable.img_privilege_4))
        datas.add(VipEquitiesPageData(5,"视频打卡","可以一键生成拼图，边拍照边拼图，多种排列方式可选，汇报省心更便捷", R.drawable.img_privilege_5))
        datas.add(VipEquitiesPageData(6,"AI去水印","智能去除照片水印功能,开通会员后,可以无限制次数去除水印", R.drawable.img_privilege_6))
        datas.add(VipEquitiesPageData(7,"自定义时间","根据您的个人需要修改打卡时间", R.drawable.img_privilege_7))
        datas
    }

    private val listPage:ArrayList<VipEquitiesPageData> by lazy {
        val datas =  ArrayList<VipEquitiesPageData>()
        datas.add(VipEquitiesPageData(1,"海量水印","涵盖多工作场景，几十种水印样式无限用，拍照更 高效", R.drawable.img_vip_page_1))
        datas.add(VipEquitiesPageData(2,"免看广告","开通会员后可免除所有位置包含[广告]标的内容", R.drawable.img_vip_page_2))
        datas.add(VipEquitiesPageData(3,"精美滤镜","开通会员后有多重精美滤镜无限使用，拍照更好看，记录美好生活幸福时光", R.drawable.img_vip_page_3))
        datas.add(VipEquitiesPageData(4,"边拼边拍","可以一键生成拼图，边拍照边拼图，多种排列方式可选，汇报省心更便捷", R.drawable.img_vip_page_4))
        datas.add(VipEquitiesPageData(5,"视频打卡","可以一键生成拼图，边拍照边拼图，多种排列方式可选，汇报省心更便捷", R.drawable.img_vip_page_5))
        datas.add(VipEquitiesPageData(6,"AI去水印","智能去除照片水印功能,开通会员后,可以无限制次数去除水印", R.drawable.img_vip_page_6))
        datas.add(VipEquitiesPageData(7,"自定义时间","根据您的个人需要修改打卡时间", R.drawable.img_vip_page_7))
        datas
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        immersionBar {
            transparentStatusBar()
            fitsSystemWindows(false)
        }

        binding.ivBack.clickWithTrigger {
            finish()
        }

        if (!AppUtil.initAdStatus){
            listTab.removeAt(1)
            listPage.removeAt(1)
        }

        binding.vpEquities.offscreenPageLimit = 2
        binding.vpEquities.adapter = VipEquitiesPageAdapter(supportFragmentManager,listPage)
        binding.tabVipEquities.setIndicatorColor(Color.TRANSPARENT)
        binding.tabVipEquities.setUpWithAdapter(VipEquitiesTabAdapter(this,binding.vpEquities,listTab))



    }

}